//app.js
let config = require('./config').config;
let moduleM = require("./manager/moduleManger.js");
let dataM = require("./manager/dataManager.js");

let updateManager;

App({
  onLaunch: function () {
    moduleM.init(this);
    dataM.init(this);
    this.dataM = dataM;
    if (wx.getUpdateManager) {
      checkUpdate();
    }
  },
  onShow: function (options) {
    this.g.options = options;
    this.log(options, "onShow options");
  },

  host: config.host,
  host_java: config.host_java,
  host_ytlImg: config.host_ytlImg,
  host_img: config.host_img
})

function checkUpdate() {
  updateManager = wx.getUpdateManager();

  updateManager.onCheckForUpdate(function (res) {
  })

  updateManager.onUpdateReady(function () {
    updateManager.applyUpdate();
  })

  updateManager.onUpdateFailed(function () {
  })
}